﻿using System.Text.Json;
using System.Text.Json.Serialization;

namespace Domain.Repository.ResponseModels
{
    public class TaskREModel
    {
        public string RC { get; set; }

        public string RM { get; set; }

        public bool IsSuccessful => "0".Equals(RC);
    }

    public class TaskRtModel<TROW> : NonStandardObject<TROW> where TROW : class
    {
        public TaskREModel RE { get; set; }

        public object ROW { get; set; }

        protected override object Obj => ROW;
    }

    public class NameTextModel
    {
        public string NAME { get; set; }

        [JsonPropertyName("#text")]
        public string text { private get; set; }

        public string txt
        {
            get
            {
                if (string.IsNullOrWhiteSpace(text))
                {
                    return "";
                }
                return text;
            }
        }
    }

    public class NameValueModel
    {
        public string NAME { get; set; }

        public string VALUE { get; set; }

        public string txt
        {
            get
            {
                if (string.IsNullOrWhiteSpace(VALUE))
                {
                    return "";
                }
                return VALUE;
            }
        }
    }
}
